security {
	// see DefaultSecurityConfig.groovy for all settable/overridable properties
	active = true
        cacheUsers = false
       // userName = "username"
       //  password = "passwd"
	loginUserDomainClass = "org.xilin.User"
	authorityDomainClass = "org.xilin.Role"
	requestMapClass = "org.xilin.Requestmap"
        config.security.useMail = true

        useRequestMapDomainClass = false

        requestMapString = """\
        CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
        PATTERN_TYPE_APACHE_ANT
        /=IS_AUTHENTICATED_ANONYMOUSLY
        /login/auth=IS_AUTHENTICATED_ANONYMOUSLY
        /js/**=IS_AUTHENTICATED_ANONYMOUSLY
        /css/**=IS_AUTHENTICATED_ANONYMOUSLY
        /images/**=IS_AUTHENTICATED_ANONYMOUSLY
        /plugin/**=IS_AUTHENTICATED_ANONYMOUSLY
        /staff/**=IS_AUTHENTICATED_FULLY,ROLE_STAFF,ROLE_ADMIN
        /admin/**=IS_AUTHENTICATED_FULLY,ROLE_ADMIN
        /myxilin/**=IS_AUTHENTICATED_FULLY,ROLE_USER,ROLE_ADMIN,ROLE_TEACHER
        /family/**=IS_AUTHENTICATED_FULLY,ROLE_USER,ROLE_ADMIN
        /student/**=IS_AUTHENTICATED_FULLY,ROLE_USER,ROLE_ADMIN
        /course/index=IS_AUTHENTICATED_ANONYMOUSLY
        /course/list=IS_AUTHENTICATED_ANONYMOUSLY
        /course/show/**=IS_AUTHENTICATED_ANONYMOUSLY
        /course/**=IS_AUTHENTICATED_FULLY,ROLE_ADMIN
        /book/index=IS_AUTHENTICATED_ANONYMOUSLY
        /book/list=IS_AUTHENTICATED_ANONYMOUSLY
        /book/show/**=IS_AUTHENTICATED_ANONYMOUSLY
        /book/**=IS_AUTHENTICATED_FULLY,ROLE_ADMIN
        /teacher/index=IS_AUTHENTICATED_ANONYMOUSLY
        /teacher/list=IS_AUTHENTICATED_ANONYMOUSLY
        /teacher/**=IS_AUTHENTICATED_FULLY,ROLE_ADMIN
        /roomschedule/index=IS_AUTHENTICATED_ANONYMOUSLY
        /roomschedule/list=IS_AUTHENTICATED_ANONYMOUSLY
        /roomschedule/show/**=IS_AUTHENTICATED_ANONYMOUSLY
        /roomschedule/**=IS_AUTHENTICATED_FULLY,ROLE_ADMIN
        /**=IS_AUTHENTICATED_ANONYMOUSLY
        """

    useMail = true
    emailAddressConfirmation = true
    mailHost = 'smtp.gmail.com'
    mailUsername = 'xilin.it@gmail.com'
    mailPassword = 'xilinxilin'
    mailProtocol = 'smtp'
    mailFrom = 'xilin.it@gmail.com'
    mailPort = 465

    //required by gmail smtp server
    javaMailProperties = [
        'mail.smtp.auth':'true',
        'mail.smtp.starttls.enable':'true',
        'mail.smtp.socketFactory.port':'465',
        'mail.smtp.socketFactory.class':'javax.net.ssl.SSLSocketFactory',
        'mail.smtp.socketFactory.fallback':'false'
    ]

}


